import torch

# tensor = torch.ones(4, 4)
tensor = torch.tensor(
[
    [1,2,3,4],
    [5,6,7,8],
    [9,10,11,12],
    [13,14,15,16]
]
)
print(f"Original tensor:\n {tensor}")
print(f"First row tensor[0]: {tensor[0]}")
print(f"First column tensor[:, 0]: {tensor[:, 0]}")
print(f"Last column tensor[..., -1]: {tensor[..., -1]}")
print(f"Set tensor[:,1] = 0")
tensor[:,1] = 0
print(tensor)
print(f"t1 = torch.cat([tensor, tensor, tensor], dim=1)")
t1 = torch.cat([tensor, tensor, tensor], dim=1)
print(t1)
print(f"t2 = torch.cat([tensor, tensor, tensor], dim=0)")
t2 = torch.cat([tensor, tensor, tensor], dim=0)
print(t2)

